<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>质量反馈处理单基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <!--<link rel="stylesheet" href="/qbdmsStatic/style/forms/currencyCss.css">-->
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <link rel="stylesheet" href="${ctx}/css/formpdf.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body class="listBody">
<style type="text/css" media="print">
    @media print {
        .noprint {
            display: none;
        }

        .printForm {
            display: block !important;
            width: 98%;
        }
    }
</style>
<!--startprint-->
<!--<script type="text/html" template>-->
<#if pdf!="pdf">
<div class="qbdms-bodyDiv"><!--浏览器展示使用-->
</#if>
<#if pdf=="pdf">
<div class="qbdms-bodyDiv" style="height: auto"><!--打印使用-->
</#if>
    <div class="layui-table-view-body qbdms-add-view-body">
        <form class="formPreview layui-form" requrl="${ctx}/qbdms/wQbdFalProblemreset/get" style="padding: 0"
              lay-filter="wQbdFalProblemresetDataForm">
            <div id="printForm">
            <div class="qbdms-formTitle">质量问题归零确认单 <#if pdf!="pdf"><i class="qbdms-returnOn closeWindow">返回</i></#if></div>
            <div class="layui-form-item" style="display: none;">
                <label class="layui-form-label">主键</label>
                <div class="doNotDelThisDiv">
                    <input type="text" name="id" autocomplete="off" class="layui-input" maxlength="50" fieldname="id"
                           readonly>
                </div>
            </div>
        <div class="" style="width: 100%;overflow-x: auto">
            <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        单位<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.filldept}
                    </td>

                    <td class="qbdms-zeroTable-lable">
                        姓名<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fillman}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        密级<span style="color: red;">*</span>
                    </td>
                    <td>
                        <#if data.secret==1>
                            公开
                        </#if>
                        <#if data.secret==2>
                            内部
                        </#if>
                        <#if data.secret==3>
                            秘密
                        </#if>
                        <#if data.secret==4>
                            机密
                        </#if>
                    </td>
                </tr>
                <td class="qbdms-zeroTable-lable">
                    质量问题名称<span style="color: red;">*</span>
                </td>
                <td>
                    ${data.fProblemname}
                </td>
                <td class="qbdms-zeroTable-lable">
                    问题发生时间<span style="color: red;">*</span>
                </td>
                <td>
                    ${(data.fDetecttime?string('yyyy-MM-dd'))!}
                </td>
                <td class="qbdms-zeroTable-lable">
                    型号研制阶段<span style="color: red;">*</span>
                </td>
                <td>
                    ${data.fModeldevelopphase}
                </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        型号代号<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fModelsymbol}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        型号名称<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fModelname}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        工作阶段<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fWorkphase1}
                    </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        型号批次
                    </td>
                    <td>
                        ${data.fModelbatchno}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        型号类别<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fModeltype}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        故障产品名称
                    </td>
                    <td>
                        ${data.fProductname}
                    </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        生产分类<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fProduceclass}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        故障产品设计单位
                    </td>
                    <td>
                        ${data.fProductdesigndept}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        故障产品生产单位
                    </td>
                    <td>
                        ${data.fProductproducedept}
                    </td>
                </tr>
                <tr class="">

                    <td class="qbdms-zeroTable-lable">
                        问题等级
                    </td>
                    <td>
                        ${data.fProblemrank}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        问题级别<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fProblemlever}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        是否三类问题<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fIfthree}
                    </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        归零周期(天)
                    </td>
                    <td>
                        ${data.fResetday}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        归零方式
                    </td>
                    <td>
                        ${data.fResettype}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        原因分类(一级)<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fCausationclass1}
                    </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        原因分类(二级)
                    </td>
                    <td>
                        ${data.fCausationclass2}
                    </td>

                    <td class="qbdms-zeroTable-lable">
                        原因分类(三级)<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fCausationclass3}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        质量部门负责人
                    </td>
                    <td>
                        ${data.qualityLeader}
                    </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        是否完成归零<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fIfreset}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        问题责任单位<span style="color: red;">*</span>
                    </td>
                    <td>
                        ${data.fDutydept}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        技术归零时间
                    </td>
                    <td>
                        ${(data.fSkillresettime?string('yyyy-MM-dd'))!}
                    </td>
                </tr>
                <tr class="">
                    <td class="qbdms-zeroTable-lable">
                        管理归零时间
                    </td>
                    <td>
                    ${(data.fManageresettime?string('yyyy-MM-dd '))!}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        解决情况
                    </td>
                    <td>
                        ${data.fSolveresult}
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        确认时间
                    </td>
                    <td>
                        ${data.fIschange!}
                    </td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">
                        综合质量处理意见
                    </td>
                    <td class=" " >
                        <textarea type="text" name="fZhzlclyj" style="height:190px;width:98%;border: none"
                                  placeholder="综合质量处理意见" lay-verify="required"
                                  autocomplete="off" class="layui-input " maxlength="100"> ${data.fZhzlclyj} </textarea>
                        <!-- 注意,这个span是用来放置上面的文本域内容,用来处理pdf. -->
                        <span id="pdftext1" class="pdftext" style="display:none" class="">${data.fZhzlclyj} </span>
                    </td>
                    <td class="qbdms-zeroTable-lable">
                        科研部门领导意见
                    </td>
                    <td class=" " >
                        <textarea style="height:190px;width:98%;border: none" type="text" name="fKybmldyj"
                                  placeholder="科研部门领导意见"
                                  autocomplete="off" class="layui-input " maxlength="100">${data.fKybmldyj}</textarea>
                        <span id="pdftext2" class="pdftext"  style="display:none">${data.fKybmldyj}</span>
                    </td>
                    <td class="qbdms-zeroTable-lable"></td>
                    <td></td>
                </tr>
                </tbody>
            </table>
        </div>
            <!--<div class="layui-form-item btnformItem">-->
            <!--<p>-->
            <!--<span id="hideAndShow" style="display: none;">-->
            <!--<a lay-submit lay-filter="wQbdTecBasicmanage" class="layui-btn btn-n privateSubmit qbdms-oneBtn"-->
            <!--requrl="/qbdms/wQbdTecBasicmanage/save">提交</a>-->
            <!--</span>-->
            <!--<button type="reset" id="" style="margin-left: 10px;"-->
            <!--class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">取消-->
            <!--</button>-->
            <!--</p>-->
            <!--</div>-->
            </div>
            <div class="noprint layui-form-item btnformItem">
                <!--endprint-->
                <#if pdf!="pdf">
                    <p>
                        <a lay-submit lay-filter="wQbdFalProblemreset" class="layui-btn btn-n privateSubmit qbdms-oneBtn"
                           requrl="${ctx}/qbdms/wQbdFalProblemreset/savegl">提交</a>
                        <button type="reset" id="closeWindow" style="margin-left: 10px;"
                                class="layui-btn layui-btn-sm qbdms-oneBtnLine btn-save">关闭
                        </button>
                        <button type="button" style="margin-left: 10px;" onclick="onPrint()"
                                class="layui-btn btn-n qbdms-oneBtnLine btn-save">打印
                        </button>
                        <button type="button" style="margin-left: 10px;" onclick="createPDF()"
                                class="layui-btn btn-n qbdms-oneBtnLine btn-save">下载pdf
                        </button>

                    </p>
                </#if>
            </div>
            <!--</div>-->
        </form>
    </div>
</div>
<!--// </script>-->
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/json/comboselect.js" type="text/javascript"></script>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script src="${ctx}/extends/jquery.min.js" type="text/javascript"></script>
<script src="${ctx}/qbdmsStatic/public/html2canvas.min.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter', 'form', 'element', 'layer', 'form', 'table', 'propsHandle', 'upload', 'common', 'laydate', 'jquery', 'publicMethods'], function () {
        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            publicMethods = layui.publicMethods,
            setter = layui.setter,  // 配置信息
            layer = layui.layer,
            propsHandle = layui.propsHandle,
            form = layui.form,
            upload = layui.upload,
            formId = '${formDefId}' || '',
            defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                formAreaInfo: 'html',
                temDate: '.temDate',
                uploadFileBtn: '.uploadFileBtn',
                uploadImgBtn: '.uploadImgBtn',
                richTextArea: '.richTextArea',
                selectInput: '.selectInput',
                radioOptionCont: '.radioOptionCont',
                dataLexiTree: '.dataLexiTree',
                selectorBtn: '.selectorBtn'
            },
            temQuery = new propsHandle()  // 实例化模板功能部分
        ;
        $("[lay-verify='required']").attr("lay-verify", "");

        //- 添加表单验证规则 开始 ---------------------------------------------------------------------
        form.verify({
            integer: [/^[+]{0,1}(\d+)$/, '请输入正整数'],
            money: [/^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, '请输入合适金额'],
            length100: [/^.{0,100}$/, '输入字符数不能超过100'],
            length2000: [/^.{0,2000}$/, '输入字符数不能超过2000']
        });

        // 初始化模板功能
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });

        // 子表初始化事件
        temQuery.initSubEvent(defProps, serverPath, setter);


        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }

        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdFalProblemreset/view/list';
        });


        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        var common = layui.common;
        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name: 'wQbdFalProblemresetDataForm',
            idValue: "${id}",
            primary: "id",
            formCallback: function () {
                alert("formCallback");
            },
            updateCallback: function (data) {
                if (publicMethods._filterRecord(data)) {
                    if ($(".privateSubmit")) {
                        $(".privateSubmit").attr("disabled", false).css("pointer-events", "auto");
                    }
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        layer.close(index);
                        window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdFalProblemreset/view/list';
                    });
                } else {
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                }
                return false;
            }
        });


        //- 责任追究div控制代码 绑事件 结束 -------------------------------------------------------------


        //-- 初始化 数据字典 开始 --------------------------------------------------------------
        var mjList = eval('${mjList}'); //密级
        initDicData("fSecret", mjList);

        var sfList = eval('${sfList}'); //是否
        initDicData("fIfreset", sfList, "否");
        initDicData("fIffirstfly", sfList, "否");
        initDicData("fIfshooting", sfList, "否");
        initDicData("fIfbatch", sfList, "否");
        initDicData("fIfmating", sfList, "否");
        initDicData("fConfirmdutyinvest", sfList, "否");
        initDicData("fIfduty", sfList, "否");
        initDicData("s:wQbdCalRewandpuns:fIfpunishment", sfList, "否");

        var xhyzjdList = eval('${xhyzjdList}'); //型号研制阶段
        initDicData("fModeldevelopphase", xhyzjdList);

        var xhlxList = eval('${xhlxList}'); //型号类别
        initDicData("fModeltype", xhlxList);

        var gzjdList = eval('${gzjdList}'); //工作阶段
        initDicData("fWorkphase1", gzjdList);

        var scflList = eval('${scflList}'); //生产分类
        initDicData("fProduceclass", scflList);

        var gzjjdList = eval('${gzjjdList}'); //故障件阶段
        initDicData("fBreakphase", gzjjdList);

        var cpjbList = eval('${cpjbList}'); //产品级别
        initDicData("fProductlevel", cpjbList);

        var spslwtList = eval('${spslwtList}'); //是否三类问题
        initDicData("fIfthree", spslwtList, "否");

        var wtdjList = eval('${wtdjList}'); //问题等级
        initDicData("fProblemrank", wtdjList, "一般");

        var yjrjList = eval('${yjrjList}'); //硬件/软件
        initDicData("fSofthard", yjrjList);

        var wtjbList = eval('${wtjbList}'); //问题级别
        initDicData("fProblemlever", wtjbList, "院级");

        var wtclfsList = eval('${wtclfsList}'); //问题处理方式
        initDicData("fMeasureclass", wtclfsList);

        var zrswxzList = eval('${zrswxzList}'); //责任单位性质
        initDicData("fDutydeptnature", zrswxzList);

        var glfsList = eval('${glfsList}'); //归零方式
        initDicData("fResettype", glfsList);

        var jjqkList = eval('${jjqkList}'); //解决情况
        initDicData("fSolveresult", jjqkList);

        var xyList = eval('${xyList}'); //行业
        initDicData("fIndusty", xyList);

        var wxxzList = eval('${wxxzList}'); //外协性质
        initDicData("fOutnature", wxxzList);

        var rjdjList = eval('${rjdjList}'); //软件等级
        initDicData("fSoftrank", rjdjList);

        var zrzjlbList = eval('${zrzjlbList}'); //责任追究类别
        initDicData("fDutyinvestigationtyp", zrzjlbList);

        var xhdh = eval('${wQbdXhdhs}'); //型号代号
        var initXHDH = function (optionObj, item) {
            optionObj.text = item.fModelcode;
            optionObj.value = item.fModelcode;
            optionObj.setAttribute("xhmc", item.fModelname);
        };
        initDicData("fModelsymbol", xhdh, "", initXHDH);

        form.on('select(xh)', function (data) {
            $("input[name='fModelname']").val(data.elem[data.elem.selectedIndex].getAttribute("xhmc"));
        });


        /**
         * 初始化数据字典
         * @param objName
         * @param dataList
         * @param defaultVal 默认值
         * @param callbackFun 其他表数据
         */
        function initDicData(objName, dataList, defaultVal, callbackFun) {
            if (document.getElementsByName(objName).length == 0) {
                return;
            }

            for (var i = 0; i < document.getElementsByName(objName).length; i++) {
                var optionObj = document.createElement("option");
                document.getElementsByName(objName)[i].appendChild(optionObj);
                for (var j = 0; j < dataList.length; j++) {
                    var item = dataList[j];
                    var optionObj = document.createElement("option");
                    optionObj.text = item.itemName;
                    optionObj.value = item.itemValue;
                    typeof callbackFun == "function" ? callbackFun(optionObj, item) : null;
                    document.getElementsByName(objName)[i].appendChild(optionObj);
                }
            }

            //看是否有默认值，有就赋值，没有就退出
            if (!defaultVal) {
                form.render();
                return;
            }

            setSeleceDefaultVal(objName, defaultVal);

            form.render();
        }

        /**
         * 设置下拉框的默认值
         * @param objName
         * @param defaultVal
         */
        function setSeleceDefaultVal(objName, defaultVal) {
            if (!defaultVal && !objName) {
                return;
            }

            var ops = document.getElementsByName(objName).item(0).options;
            for (var i = 0; i < ops.length; i++) {
                var tempValue = ops[i].value;
                if (tempValue == defaultVal) {
                    ops[i].selected = true;
                }
            }
        }

        //-- 初始化 数据字典 结束 --------------------------------------------------------------

        //-- 附件上传 开始 --------------------------------------------------------------
        //下载附件
        window.downFile = function (obj) {
            var fileId = $(obj).parents("span").attr("fileId");
            window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
        }
        // 删除
        $(document).on('click', '.deleteFile', function () {
            $(".uploadFileList").each(constructFileStr);
        });

        var uploadInst = upload.render({
            elem: ".fileUpload" //绑定元素
            , url: serverPath.qbdmsPath + setter.sysLinkPath + 'attachFile/fileUpload' //上传接口
            , multiple: true
            , accept: 'file'
            , auto: true
            , number: 0
            , done: function (res) {
                if (res.code === 0 && res.data && res.data.fileList.length > 0) {
                    var fileOne = res.data.fileList[0],
                        oneFile = '<span class="file-id" style="margin-right: 20px;" fileId=' + fileOne.fileId + '><span class="file-name" onclick="downFile(this)">' + fileOne.fileName + '.' + fileOne.extName + '</span>' +
                            '<i class="layui-icon layui-icon-delete deleteFile" ></i></span>';
                    this.item.siblings(".uploadFileList").append(oneFile);

                    //-  附件 开始 ------------------------------------------------------
                    this.item.siblings(".uploadFileList").each(constructFileStr);
                    //- 附件 开始 ------------------------------------------------------
                }
            }
            , error: function () {
            }
        });

        //构建file的字符串
        function constructFileStr() {
            var filesJsonStr = "";
            $(this).find(".file-id").each(function () {
                var fileId = this.getAttribute("fileid");
                var fileName = this.getElementsByTagName("span").item(0).innerText
                filesJsonStr += '{"fileId":"' + fileId + '","fileName":"' + fileName + '"},';
            });
            filesJsonStr = filesJsonStr.substring(0, filesJsonStr.length - 1);
            if (filesJsonStr != "") {
                filesJsonStr = '[' + filesJsonStr + ']';
            }
            var fileUploadName = $(this).attr("fileUploadName");
            $("#" + fileUploadName).val(filesJsonStr);
        }

        //-- 附件上传 结束 --------------------------------------------------------------


        //-- 子表数据 开始 --------------------------------------------------------------
        function handNumberData(obj) {
            var value = $(obj).val();
            var showType = $(obj).attr("showtype");
            if (!showType) return value;
            try {
                showType = showType.replaceAll("'", "\"");
                var json = jQuery.parseJSON(showType);
                var coinvalue = json.coinValue;
                var isShowComdify = json.isShowComdify;
                if (coinvalue != null && coinvalue != '' && value.split(coinvalue) != -1) {
                    var ary = value.split(coinvalue);
                    value = ary.join("");
                }
                if (isShowComdify && value.split(",") != -1) {
                    var temp = value.split(",");
                    value = temp.join("");
                }
            } catch (err) {
            }
            return value;
        }

        //-- 子表数据 结束 --------------------------------------------------------------

        //-- 设置控件是否必填 开始 --------------------------------------------------------------
        /**
         * 设置控件是否必填，按照isRequired值设置是必填还是不必填
         * 统一构造lay-verify所必须的字符串，然后设置该属性
         * @param componentName
         * @param isRequired
         */
        var setComponentRequired = function (componentNameArr, isRequired, validCondition) {
            if (!validCondition) {
                validCondition = "required";
            }
            for (var i = 0, len = componentNameArr.length; i < len; i++) {
                var componentName = componentNameArr[i];

                if ($("[name='" + componentName + "']").length == 0) {
                    return;
                }
                // lay-verify="required"
                var verifyStr = $("[name='" + componentName + "']").attr("lay-verify");
                if (verifyStr == null) {
                    verifyStr = "";
                }
                if (isRequired) {
                    verifyStr += "|" + validCondition;
                } else {
                    verifyStr = verifyStr.replace("|" + validCondition, "");
                    verifyStr = verifyStr.replace(validCondition, "");
                }
                $("[name='" + componentName + "']").attr("lay-verify", verifyStr);
            }
        }
        //-- 设置控件是否必填 结束 --------------------------------------------------------------


        //-- 清空表单控件值 开始 --------------------------------------------------------------
        var clearComponentVal = function (componentNameArr) {
            for (var i = 0, len = componentNameArr.length; i < len; i++) {
                var componentName = componentNameArr[i];
                var objArr = document.getElementsByName(componentName);

                if (objArr.length == 0) {
                    return;
                }
                for (var j = 0; j < objArr.length; j++) {
                    document.getElementsByName(componentName).item(j).value = "";
                }
            }
            layui.form.render("select");
        };
        //-- 清空表单控件值 结束 --------------------------------------------------------------

        publicMethods.bottomFixd()
    });

    function doPrint() {
        bdhtml = window.document.body.innerHTML; //获取当前页的html代码
        sprnstr = "<!--startprint-->"; //设置打印开始区域
        eprnstr = "<!--endprint-->";//设置打印结束区域
        prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);//从开始代码向后取html
        prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html
        window.document.body.innerHTML = prnhtml;
        window.print();
    }

    //放置脚本打印
    function onPrint() {
        var printBox = document.getElementById('printForm');
        //拿到打印的区域的html内容
        var newContent = printBox.innerHTML;
        //将旧的页面储存起来，当打印完成后返给给页面。
        var oldContent = document.body.innerHTML;
        //赋值给body
        document.body.innerHTML = newContent;
        //执行window.print打印功能
        window.print();
        // 重新加载页面，以刷新数据。以防打印完之后，页面不能操作的问题
        window.location.reload();
        document.body.innerHTML = oldContent;
        return false;
    };

    //PDF打印
    function createPDF() {
        var id = document.getElementsByName("id")[0].value;
        var tempele=document.getElementsByClassName("closeWindow");
        for(var i=0;i<tempele.length;i++){
            tempele[i].style.display = "none";
        }
        $('#pdftext1').val($('textarea[name="fZhzlclyj"]').val());
        $('#pdftext2').val($('textarea[name="fKybmldyj"]').val());
        $('textarea[name="fZhzlclyj"]').hide()
        $('textarea[name="fKybmldyj"]').hide()
        $('#pdftext1').show();
        $('#pdftext2').show();
        var oldwid=$('#printForm').width();
        $('#printForm').css('min-width',($('.qbdms-zeroTable').width()));
        html2canvas(document.getElementById('printForm'),{width:$('.qbdms-zeroTable').width()}).then(function(canvas) {
            var base64Image = canvas.toDataURL('image/png').substring(22);
            var parames = new Array();
            parames.push({ name: "id", value: id});
            parames.push({ name: "sanyuan", value: 0});
            parames.push({ name: "picstr", value: base64Image});
            simulationPost('${ctx}/qbdms/wQbdFalProblemreset/createPDF',parames);
        });
        for(var i=0;i<tempele.length;i++){
            tempele[i].style.display = "block";
        }
        $('#pdftext1').hide();
        $('#pdftext2').hide();
        $('textarea[name="fZhzlclyj"]').show()
        $('textarea[name="fKybmldyj"]').show()
        $('#printForm').css('min-width', oldwid);
    }
    /**
     * 模拟表单提交,用来下载pdf..
     * @author zzy
     * @param URL
     * @param PARAMTERS
     */
    function simulationPost(URL, PARAMTERS) {
        var temp_form = document.createElement("form");
        temp_form.action = URL;
        temp_form.target = "_self";
        temp_form.method = "post";
        temp_form.style.display = "none";
        //添加参数
        for (var item in PARAMTERS) {
            var opt = document.createElement("textarea");
            opt.name = PARAMTERS[item].name;
            opt.value = PARAMTERS[item].value;
            temp_form.appendChild(opt);
        }
        document.body.appendChild(temp_form);
        temp_form.submit();
    }
</script>

<style>
    .tableCut {
        padding: 0px !important;
        position: relative;
        width: 100px;
        background: url("${ctx}/formStatic/style/res/cut.png") no-repeat center center !important;
        background-size: 100% 100% !important
    }

    .tableCut > div:nth-child(1) {
        position: absolute;
        top: 5%;
        right: 3px;

    }

    .tableCut > div:nth-child(2) {
        position: absolute;
        top: 38%;
        right: 3px;
    }

    .tableCut > div:nth-child(3) {
        position: absolute;
        bottom: 5%;
        left: 10px;
    }

    .doNotDelThisDiv {
        min-height: 36px;
    }

    .uploadFileList > span {
        display: block;
    }
</style>
</body>
</html>